﻿@{
    Layout = "_LayoutPhone";
}
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" />

<link rel="apple-touch-icon" href="~/GoTRI/img/favicon-apple.png">
<link rel="icon" href="~/GoTRI/img/favicon.png">


<!-- Material design icons CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/materializeicon/material-icons.css">

<!-- aniamte CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/animatecss/animate.css">

<!-- swiper carousel CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/swiper/css/swiper.min.css">

<!-- daterange CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/bootstrap-daterangepicker-master/daterangepicker.css">

<!-- footable CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/footable-bootstrap/css/footable.bootstrap.min.css">

<!-- jvector map CSS -->
<link rel="stylesheet" href="~/GoTRI/vendor/jquery-jvectormap/jquery-jvectormap-2.0.3.css">

<!-- app CSS -->
<link id="theme" rel="stylesheet" href="~/GoTRI/css/purplesidebar.css" type="text/css">
<!-- Application main common jquery file -->
@*<script src="~/admui-13945148017-1592211513218/public/vendor/bootstrap-sweetalert/sweetalert.min.js"></script>
    <script src="~/admui-13945148017-1592211513218/public/themes/global/js/components/bootstrap-sweetalert.min.js"></script>
    <script src="~/admui-13945148017-1592211513218/public/js/examples/components/advanced/bootbox-sweetalert.min.js"></script>*@
<script src="~/admui-13945148017-1592211513218/public/js/tsk/sweetalert.min.js"></script>
<script>

    $(document).ready(function () {
        zhanghaohq();
    });

    function zhanghaohq()
    {
        $.ajax({
            type: "POST",
            url: "../RenYuan/HQZhangHao",
            cache: false,  //禁用缓存
            dataType: "text",
            success: function (result) {
                $("#txt_ZhangHao").val(result);
            }
        });
    }

    function Submit() {
        var MiMa = $("#txt_MiMa").val();
        var xinMiMa = $("#txt_xinMiMa").val();
        if ($.trim(MiMa).length == 0) {
            swal("失败提示!", "请填写原密码!", "error");
            return;
        }
        if ($.trim(xinMiMa).length == 0) {
            swal("失败提示!", "请填写新密码!", "error");
            return;
        }

        if (MiMa.trim() == xinMiMa.trim())
        {
            swal("请更改密码!", "新密码不能和原密码相同!", "error");
            return;
        }

        $.ajax({
            type: "POST",
            url: "../RenYuan/XueGaiMiMa",
            cache: false,  //禁用缓存
            data: { "MiMa": "" + MiMa + "", "xinMiMa": "" + xinMiMa + "" },  //传入组装的参数
            dataType: "text",
            success: function (result) {
                if (result == "1") {
                    swal("原密码错误!", "密码错误!", "error");
                } else if (result == "2") {
                    swal("修改成功!", "操作成功!", "success");
                    setTimeout(function () {
                        location.href = "../RenYuan/BindWeiXin";
                    }, 2000);
                } else {
                    swal("操作失败请重新修改!", "该账号不存在!", "error");
                }
            }
        });

    }

    function getQuery(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg);
        if (r != null) return decodeURI(r[2]); return null;
    }
</script>
<div class="container mt-4 main-container">
    <div class="card mb-4">
        <div class="card-body">
            <div class="row justify-content-center">
                <div class="col-md-10 mx-auto" style="margin-bottom:-40px;">
                    <div class="row ">
                        <div class="col-lg-6 col-md-6">
                            <div class="form-group ">
                                <label>账号<span style="color:red;">*</span></label>
                                <input type="text" id="txt_ZhangHao" disabled="disabled" class="form-control" placeholder="">
                            </div>
                        </div>
                        <div class="col-lg-6 col-md-6">
                            <div class="form-group ">
                                <label>原密码<span style="color:red;">*</span></label>
                                <input type="text" id="txt_MiMa" class="form-control" placeholder="">
                            </div>
                        </div>
                        <div class="col-lg-6 col-md-6">
                            <div class="form-group ">
                                <label>新密码<span style="color:red;">*</span></label>
                                <input type="password" id="txt_xinMiMa" class="form-control" placeholder="">
                            </div>
                        </div>
                    </div>

                    <br>

                </div>
            </div>
        </div>
        <div class="card-footer" style="text-align: center;width:100%">
            <button class="btn btn-success float-right" onclick="Submit();" style="width:100%">修改</button>
        </div>
    </div>
</div>